package com.power.using.askapp.utils;

import android.util.Log;

/**
 * 项目名称:YZDSuperviseP
 * 创建人:zhangtainjia
 * 创建时间:2017/3/17 10:54
 * 作用：证件类集合工具
 */

public class CredentialsHelper {
    public static String getcredentials(String id){
        String display="";
        String tdisplay="";
        String title="";
        String type = "buy";
        if (id.indexOf("G")==-1 && id.indexOf("Y")==-1){
            String newid=id;
                newid=newid.replace("陕公禁毒","");
                String sign=newid.substring(8,12);
                if (sign.startsWith("01")){
                    if (sign.startsWith("011")){
                        title="第一类易制毒化学品购买许可证";
                    }
                    else {
                        display="none";
                        title="第二类、第三类易制毒化学品购买备案证明";
                    }
                    type="buy";
                }else {
                    display = "";
                    tdisplay = "none";
                    if(sign.equals("0213")){
                        title="第三类易制毒化学品运输备案证明";
                        tdisplay="";
                        display="none";
                    }else title="第一类、第二类易制毒化学品运输许可证";
                    type = "tra";
                }

        }else {
            String sign = id.substring(6,8);
            if(sign.startsWith("G")){
                if(sign.equals("GX"))
                    title="第一类易制毒化学品购买许可证";
                else{
                    display = "none";
                    title="第二类、第三类易制毒化学品购买备案证明";
                }
                type = "buy";
            }else{
                display = "";
                tdisplay = "none";
                if(sign.equals("YB")){
                    title="第三类易制毒化学品运输备案证明";
                    tdisplay="";
                    display="none";
                }else title="第一类、第二类易制毒化学品运输许可证";
                type = "tra";
            }
        }
        Log.e("abcdefg",type+"   "+display+"   "+tdisplay+"    "+id);
        return type+":"+display+":"+tdisplay+":"+title;

    }
    public static String get(String id){
        String display="";
        String tdisplay="";
        String title="";
        String type = "buy";
        if (id.indexOf("G")==-1 && id.indexOf("Y")==-1){
            String newid=id;
            if (newid.indexOf("陕公禁毒")!=-1){
                newid=newid.replace("陕公禁毒","");
                String sign=newid.substring(8,12);
                if (sign.startsWith("01")){
                    if (sign.startsWith("011")){
                        title="第一类易制毒化学品购买许可证";
                    }
                    else {
                        display="none";
                        title="第二类、第三类易制毒化学品购买备案证明";
                    }
                    type="cert_buy_";
                }else {
                    display = "";
                    tdisplay = "none";
                    if(sign.equals("0213")){
                        title="第三类易制毒化学品运输备案证明";
                        tdisplay="";
                        display="none";
                    }else title="第一类、第二类易制毒化学品运输许可证";
                    type = "cert_tra_";
                }
            }
        }else {
            String sign = id.substring(6,8);
            if(sign.startsWith("G")){
                if(sign.equals("GX"))
                    title="第一类易制毒化学品购买许可证";
                else{
                    display = "none";
                    title="第二类、第三类易制毒化学品购买备案证明";
                }
                type = "cert_buy_";
            }else{
                display = "";
                tdisplay = "none";
                if(sign.equals("YB")){
                    title="第三类易制毒化学品运输备案证明";
                    tdisplay="";
                    display="none";
                }else title="第一类、第二类易制毒化学品运输许可证";
                type = "cert_tra_";
            }
        }

        return type+":"+display+":"+tdisplay+":"+title;

    }
}
